#ifndef SWEGL_SURFACE_H
#define SWEGL_SURFACE_H

namespace swegl
{

class Surface
{	
public:
	Surface(uint m_width, uint m_height, uint32 *buffer = 0);
	~Surface();

	uint width() const;
	uint height() const;

	void *data();
	const void *data() const;

	template <typename T> T *data();
	template <typename T> const T *data() const;

	void clear(uint32 value);
	void clear(float value);

private:
	uint m_width;
	uint m_height;
	uint32 *m_data;
};

inline uint Surface::width() const
{
	return m_width;
}

inline uint Surface::height() const
{
	return m_height;
}

inline void *Surface::data()
{
	return m_data;
}

inline const void *Surface::data() const
{
	return m_data;
}

template <typename T>
inline T *Surface::data()
{
	return reinterpret_cast<T *>(m_data);
}

template <typename T>
inline const T *Surface::data() const
{
	return reinterpret_cast<const T *>(m_data);
}

}

#endif

